
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>店铺设置</title>
    <link rel="stylesheet" href="/template/mobile/new2/static/css/style.css">
    <link rel="stylesheet" type="text/css" href="/template/mobile/new2/static/css/iconfont.css"/>
    <script src="/template/mobile/new2/static/js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/template/mobile/new2/static/js/style.js" type="text/javascript" charset="utf-8"></script>
    <script src="/template/mobile/new2/static/js/mobile-util.js" type="text/javascript" charset="utf-8"></script>
    <script src="/public/js/global.js"></script>
    <script src="/template/mobile/new2/static/js/layer.js"  type="text/javascript" ></script>
    <script src="/template/mobile/new2/static/js/swipeSlide.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body class="[body]">

<div class="classreturn loginsignup ">
    <div class="content">
        <div class="ds-in-bl return">
            <a href="javascript:history.back(-1)"><img src="/template/mobile/new2/static/images/return.png" alt="返回"></a>
        </div>
        <div class="ds-in-bl search center">
            <span>店铺设置</span>
        </div>
        <div class="ds-in-bl menu">
            <a href="javascript:void(0);"><img src="/template/mobile/new2/static/images/class1.png" alt="菜单"></a>
        </div>
    </div>
</div>
<div class="flool tpnavf">
    <div class="footer">
        <ul>
            <li>
                <a class="yello" href="/index.php/mobile/Index/index.html">
                    <div class="icon">
                        <i class="icon-shouye iconfont"></i>
                        <p>首页</p>
                    </div>
                </a>
            </li>
            <!--<li>-->
                <!--<a href="/index.php/mobile/Goods/categoryList.html">-->
                    <!--<div class="icon">-->
                        <!--<i class="icon-fenlei iconfont"></i>-->
                        <!--<p>分类</p>-->
                    <!--</div>-->
                <!--</a>-->
            <!--</li>-->
            <li>
                <!--<a href="shopcar.html">-->
                <a href="/index.php/mobile/Cart/cart.html">
                    <div class="icon">
                        <i class="icon-gouwuche iconfont"></i>
                        <p>购物车</p>
                    </div>
                </a>
            </li>
            <li>
                <a href="/index.php/mobile/User/index.html">
                    <div class="icon">
                        <i class="icon-wode iconfont"></i>
                        <p>我的</p>
                    </div>
                </a>
            </li>
        </ul>
    </div>
</div>
<link rel="stylesheet" type="text/css" href="/template/mobile/new2/static/distribut/css/main.css"/>
<script src="/template/mobile/new2/static/js/mobile-util.js" type="text/javascript" charset="utf-8"></script>
<form id="set_store" autocomplete="off" method="post" enctype="multipart/form-data" >
    <div class="shop_seting">
        <div class="w670">
            <div class="alone_row_set">
                <span>店铺名称：</span>
                <input type="text" name="store_name" value="" />
            </div>
            <div class="alone_row_set">
                <span>真实姓名：</span>
                <input type="text"  name="true_name" value="" />
            </div>
            <div class="alone_row_set">
                <span>手机号：</span>
                <input type="text" name="mobile" value="" onkeyup="value=value.replace(/[^0-9]/g,'')"/>
            </div>
            <div class="alone_row_set">
                <span>QQ：</span>
                <input type="text"  name="qq" value="" onkeyup="value=value.replace(/[^0-9]/g,'')">
            </div>
        </div>
    </div>
    <div class="shop_img_set">
        <div class="tit_produce">
            <span class="tit_fon">店铺图片</span>
        </div>
        <div class="upload_shopbag">
            <label>
                <a id="fileList0">
                    <img src="/template/mobile/new2/static/images/m_03.jpg"/>
                </a>
                <input type="file" accept="image/*" name="store_img" onchange="handleFiles(this,0)"  style="display:none" />
                <label>
        </div>
        <div class="w670 ma-to-50 ma-bo-50">
            <a class="submit_set" href="javascript:" onClick="verifyForm1();">确认修改</a>
        </div>
    </div>
</form>
</body>
<script>
    function verifyForm1(){
        $.ajax({
            type: "POST",
            url: "/index.php/Mobile/Distribut/set_store.html",
            data: $('#set_store').serialize(),
            dataType: "json",
            error: function () {
                layer.open({content:"服务器繁忙, 请联系管理员!",time:2});
            },
            success: function (data) {
                if (data.status == 1) {
                    location.href = "/index.php/Mobile/Distribut/set_store.html";
                }
                $.each(data.result, function (index, item) {
                    layer.open({content:item,time:2});
                });
            }
        });
    }

    //上传照片
    window.URL = window.URL || window.webkitURL;
    function handleFiles(obj,id) {
        fileList = document.getElementById("fileList"+id);
        var files = obj.files;
        img = new Image();
        if(window.URL){

            img.src = window.URL.createObjectURL(files[0]); //创建一个object URL，并不是你的本地路径
            img.onload = function(e) {
                window.URL.revokeObjectURL(this.src); //图片加载后，释放object URL
            }
            if(fileList.firstElementChild){
                fileList.removeChild(fileList.firstElementChild);
            }
            fileList.appendChild(img);
        }else if(window.FileReader){
            //opera不支持createObjectURL/revokeObjectURL方法。我们用FileReader对象来处理
            var reader = new FileReader();
            reader.readAsDataURL(files[0]);
            reader.onload = function(e){
                img.src = this.result;
                fileList.appendChild(img);
            }
        }else
        {
            //ie
            obj.select();
            obj.blur();
            var nfile = document.selection.createRange().text;
            document.selection.empty();
            img.src = nfile;
            img.onload=function(){

            }
            fileList.appendChild(img);
        }
    }
</script>
</html>
